<template>
  <div
    class="jy-style-height message-box"
    :style="{
      'background-image': `url(${publicUrls + 'free/style1/publicStyle1Bg.png' + '?imageView2/3/format/webp'})`,
    }"
  >
    <div class="message-heard">
      <i class="freeIcon" @click="blankHome">&#xe642;</i>
      <span>留言板</span>
    </div>
    <div class="comment-box">
      <comment />
    </div>
    <div class="commentList-box">
      <div class="commentNum">共{{ total }}条留言</div>
      <div class="commentList-box-content">
        <ScrollBox
          color="rgba(50, 43, 37, 1)"
          :scrollSrc="publicUrls + 'free/style1/pen.png'"
          v-if="scrollheight"
          :byid="4235"
          :width="scrollheight"
        >
          <template #solidBorderCon>
            <commentList @emitTotal="emitTotal" />
          </template>
          <template #solidBorderEx>
            <div class="solidBorder-child"></div>
          </template>
        </ScrollBox>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
// @ts-nocheck
export default defineComponent({
  name: 'style1',
});
</script>

<script setup lang="ts">
// @ts-nocheck
import { defineComponent, ref } from 'vue';
import comment from '../messageComponent/style1/comment.vue';
import commentList from '../messageComponent/style1/commentList.vue';
import { publicUrls } from '@/utils/minxin';
import { commonDataStore } from '@/store';
const commonStore = commonDataStore();
import { useRouter, useRoute } from 'vue-router';
import ScrollBox from '../scrollBox.vue';
const router = useRouter();
const route = useRoute();
const total = ref(0);
const scrollheight = ref();

let viewportHeight = window.innerHeight;
scrollheight.value = viewportHeight * 0.3888;
const blankHome = () => {
  router.push({ name: route.meta.loopType ? 'exhibitionHome' : 'templateedit' });
};
const emitTotal = (num: number) => {
  total.value = num;
};
</script>

<style scoped lang="less">
.message-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 120px 0;
  padding-bottom: 100px;
  background-size: 100% 100%;
}
.message-heard {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  margin-bottom: 24px;
  padding: 0 80px;
  span {
    font-family: SourceHanSerifCN-Bold;
    font-size: 36px;
    line-height: 56px;
    text-align: center;
    color: rgba(50, 43, 37, 1);
  }
  .freeIcon {
    cursor: pointer;
    position: absolute;
    top: 8px;
    left: 80px;
    font-size: 40px;
    line-height: 40px;
    color: rgba(50, 43, 37, 1);
  }
}
.comment-box {
  width: 100%;
  padding: 0 80px;
  margin-bottom: 60px;
}
.commentList-box {
  display: flex;
  flex-direction: column;
  padding: 0 80px;
  //   flex: 1;
  height: 400px;
  width: 100%;
}

.commentNum {
  width: 100%;
  height: 24px;
  font-family: PingFang SC;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: left;
  color: rgba(50, 43, 37, 1);
  margin-bottom: 30px;
}
.commentList-box-content {
  width: 100%;
  height: calc(100% - 24px);
  // overflow: auto;
}
.solidBorder-child {
  width: 4px;
  height: 100%;
  border-radius: 1.055px;
  opacity: 0.1;
  background: #6c5c4f;
  box-sizing: border-box;
  border-left: 2px solid rgba(81, 81, 81, 1);
  border-right: 2px solid rgba(81, 81, 81, 1);
}
.commentList-box-content::-webkit-scrollbar {
  display: none;
}
</style>